﻿#region Using declarations
using System;
using System.ComponentModel;
using System.Drawing;
using System.Globalization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    /// <summary>
    /// This file holds user defined strategy method.
    /// </summary>
    partial class Strategy
    {
        ///The current market position (1 = long, -1 = short, 0 = flat).
        ///Syntax: MarketPosition()

        public int EL_MarketPosition()
        {
            int result = 0;
            if (Position.MarketPosition == MarketPosition.Long)
                result = 1;
            if (Position.MarketPosition == MarketPosition.Short)
                result = -1;
            return result;
        }

    }
}
